package com.training.entity;

import java.time.LocalDateTime;

/**
 * 课程收藏实体类
 * 对应数据库表 course_collections
 */
public class CourseCollection {
    private Long id; // 主键
    private Long courseId; // 课程ID
    private Long studentId; // 学生ID (对应 student 表的主键ID)
    private LocalDateTime createTime; // 收藏时间

    // Constructors
    public CourseCollection() {}

    public CourseCollection(Long courseId, Long studentId) {
        this.courseId = courseId;
        this.studentId = studentId;
        this.createTime = LocalDateTime.now();
    }

    // Getters and Setters
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCourseId() {
        return courseId;
    }

    public void setCourseId(Long courseId) {
        this.courseId = courseId;
    }

    public Long getStudentId() {
        return studentId;
    }

    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "CourseCollection{" +
                "id=" + id +
                ", courseId=" + courseId +
                ", studentId=" + studentId +
                ", createTime=" + createTime +
                '}';
    }
}